package timing.ukulele.portal.convertor;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import timing.ukulele.common.data.BaseDataConverter;
import timing.ukulele.data.portal.view.SysMenuPermissionVO;
import timing.ukulele.portal.persistent.SysMenuPermission;
@Mapper
public interface PermissionConverter extends BaseDataConverter<SysMenuPermission, SysMenuPermissionVO> {
    PermissionConverter INSTANCE = Mappers.getMapper(PermissionConverter.class);

    @Override
    @Mappings({
            @Mapping(target = "createBy", ignore = true),
            @Mapping(target = "createTime", ignore = true),
            @Mapping(target = "updateBy", ignore = true),
            @Mapping(target = "updateTime", ignore = true),
    })
    SysMenuPermission v2p(SysMenuPermissionVO sysMenuPermissionVO);


    @Override
    @Mappings({
            @Mapping(target = "checked", ignore = true)
    })
    SysMenuPermissionVO p2v(SysMenuPermission sysMenuPermission);
}
